import uos
from machine import SDCard


# 挂载sd卡到sd文件夹
try:
    uos.mount(SDCard(), "/sd")
except Exception as ret:
    print("挂载失败...", ret)
else:
    print("挂载成功...")
    

with open("/sd/test.txt", "w") as f:
    for i in range(1, 101):
        print(i)
        f.write(str(i)+"\n")

print("已经将1 2 3....100写入到sd卡中的text.txt文件")

